import Vue from 'vue'
export default{
	namespaced:true,
	state: {
		childInfo:{},
		schLoadNum:0,//学校系统下当前身份为学生/老师时跳转至其在学校详情页且值变为1 防止返回后再次跳转,
		syLoadNum:0,//index页面启动 当值为1时 加载onshow里面的方法 0->1是在执行完startImg服务器返回后更改
		sySqRefreshToken:0,//社区首页启动是否更新token 0否 1更新
		qyGroupId:0
	},
	mutations: {
		SET_CHILDINFO(state,data){
			Vue.set(state.childInfo,'childUserId',data.userId);
			//Vue.set(state.childInfo,'childGpId',data.mainGroupId);
			Vue.set(state.childInfo,'childGpUserId',data.groupUserId);
			Vue.set(state.childInfo,'childNameFix',data.childName);//永久性
			//Vue.set(state.childInfo,'childName',data.childName);//永久性
			Vue.set(state.childInfo,'headImg',data.headImg);
			Vue.set(state.childInfo,'schoolName',data.schoolName);
			Vue.set(state.childInfo,'childGroupName',data.schName);
		},
		ADD_CHILDNAME(state){
			state.childInfo.childName = state.childInfo.childNameFix;
		},
		SET_SCHLOADNUM(state,schLoadNum){
			state.schLoadNum = schLoadNum;
		},
		//设置首页是否调用onShow中的一些方法 1调用
		SET_SYLOADNUM(state,syLoadNum){
			state.syLoadNum = syLoadNum;
		},
		REMOVE_CHILDNAME(state){
			delete state.childInfo.childName;
		},
		REMOVE_CHILDINFO(state){
			state.childInfo = {};
		},
		SET_SYSQREFRESHTOKEN(state,sySqRefreshToken){
			state.sySqRefreshToken = sySqRefreshToken;
		},
		SET_QYGROUPID(state,value){
			state.qyGroupId = value;
		},
		// REMOVE_QYGROUPID(state){
		// 	state.qyGroupId = 0;
		// }
	}
}